﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DTO;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data;
using System.Web.Mvc;
using System.Web.Caching;
using System.Web;


namespace Ashlen.Portal.Services
{

    [DataContract]
    public class HelloDTO
    {
        [DataMember]
        public string To = "You";
        [DataMember]
        public string From = "Me";
    }

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class TestService : ITestService
    {

        public string Hello()
        {
            return "Service says hello!";
        }

        public HelloDTO HelloComplex()
        {
            return new HelloDTO { To = "You", From = "Service" };
        }

        public object HelloAnonymous()
        {
            return Newtonsoft.Json.JavaScriptConvert.SerializeObject(new { To="You", From="Service" });
        }
    }
}
